package offerv1;

import leetcodev1.链表.Solution;

public class Offer64 {
    public int sumNums1(int n) {
        return (n + 1) * n / 2;
    }

    //递归
    public int sumNums(int n) {
        boolean flag = n > 0 && (n += sumNums(n - 1)) > 0;
        return n;
    }
}
